package com.androidx.p013lv.base.dialog;

import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.view.Window;
import android.widget.RatingBar;
import android.widget.TextView;
import androidx.appcompat.widget.AppCompatRatingBar;
import com.androidx.p013lv.base.C1010R;
import java.util.Objects;

/* renamed from: com.androidx.lv.base.dialog.DialogRatingBar */
public class DialogRatingBar extends Dialog {
    private OnRatingBarCommitListener onRatingBarCommitListener;
    private float score = 5.0f;

    /* renamed from: com.androidx.lv.base.dialog.DialogRatingBar$OnRatingBarCommitListener */
    public interface OnRatingBarCommitListener {
        void onRatingBarCommit(float f);
    }

    /* access modifiers changed from: private */
    /* access modifiers changed from: public */
    private String getRatingBarStatus(float f) {
        return f <= 1.0f ? "我佛了" : (f <= 1.0f || f > 2.0f) ? (f <= 2.0f || f > 3.0f) ? (f <= 3.0f || f > 4.0f) ? "獨樂樂不如眾樂樂" : "擼點滿滿，愛了愛了！" : "平平無奇，可擼" : "強擼灰飛煙滅";
    }

    public void setOnRatingBarListener(OnRatingBarCommitListener onRatingBarCommitListener2) {
        this.onRatingBarCommitListener = onRatingBarCommitListener2;
    }

    public DialogRatingBar(Context context) {
        super(context, C1010R.C1017style.MyDialogStyle);
        ((Window) Objects.requireNonNull(getWindow())).setGravity(17);
        setContentView(C1010R.C1015layout.dialog_base_rating_bar);
        final TextView textView = (TextView) findViewById(C1010R.C1013id.tv_status);
        ((AppCompatRatingBar) findViewById(C1010R.C1013id.rating_bar)).setOnRatingBarChangeListener(new RatingBar.OnRatingBarChangeListener() {
            /* class com.androidx.p013lv.base.dialog.DialogRatingBar.C10221 */

            public void onRatingChanged(RatingBar ratingBar, float f, boolean z) {
                ratingBar.setRating(f);
                textView.setText(DialogRatingBar.this.getRatingBarStatus(f));
                DialogRatingBar.this.score = f * 2.0f;
            }
        });
        findViewById(C1010R.C1013id.rating_bar_commit).setOnClickListener(new View.OnClickListener() {
            /* class com.androidx.p013lv.base.dialog.DialogRatingBar.View$OnClickListenerC10232 */

            public void onClick(View view) {
                DialogRatingBar.this.dismiss();
                if (DialogRatingBar.this.onRatingBarCommitListener != null) {
                    DialogRatingBar.this.onRatingBarCommitListener.onRatingBarCommit(DialogRatingBar.this.score);
                }
            }
        });
    }
}
